import {RouteRecordRaw} from "vue-router"

const routes: RouteRecordRaw[] = [
    {
        path: "/",
        name: "Home",
        component: () => import("@/layouts/DefaultLayout.vue"),
        redirect: "/dashboard",
        children: [
            {
                path: "/dashboard",
                name: "dashboard",
                component: () => import("@/views/dashboard/DashBoard.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/user/info",
                name: "userInfo",
                component: () => import("@/views/user/Info.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/user/list",
                name: "userList",
                component: () => import("@/views/user/List.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/user/blockList",
                name: "blockList",
                component: () => import("@/views/block/List.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/give/sendCoin",
                name: "sendCoin",
                component: () => import("@/views/give/SendCoin.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/give/sendGood",
                name: "sendGood",
                component: () => import("@/views/give/SendGood.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/give/sendVip",
                name: "sendVip",
                component: () => import("@/views/give/SendVip.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/union/list",
                name: "unionList",
                component: () => import("@/views/union/List.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/union/memberList",
                name: "memberList",
                component: () => import("@/views/union/MemberList.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/gift/list",
                name: "monitor",
                component: () => import("@/views/gift/List.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                },

            },
            {
                path: "/gift/luck",
                name: "revenue",
                component: () => import("@/views/gift/Luck.vue"),
                meta: {
                    keepAlive: true,
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                },

            },
            {
                path: "/map",
                name: "map",
                component: () => import("@/views/map/ElectronicMap.vue")
            },
            {
                path: "/operations/orders",
                name: "orders",
                component: () => import("@/views/operations/Orders.vue"),
                meta: {
                    keepAlive: true
                }
            },
            {
                path: "/operations/detail",
                name: "detail",
                component: () => import("@/views/operations/Detail.vue")
            },
            {
                path: "/operations/total",
                name: "total",
                component: () => import("@/views/operations/Total.vue")
            },
            {
                path: "/alarm",
                name: "alarm",
                component: () => import("@/views/alarm/Alarm.vue")
            },
            {
                path: "/good/list",
                name: "goodList",
                component: () => import("@/views/good/List.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/document",
                name: "document",
                component: () => import("@/views/document/Document.vue"),
                meta: {
                    needAuth: ["admin", "kaifa"]
                }
            },
            {
                path: "/system/list",
                name: "systemList",
                component: () => import("@/views/system/List.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }
            },
            {
                path: "/personal",
                name: "personal",
                component: () => import("@/views/personal/Personal.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }

            },
            {
                path: "/white/loginList",
                name: "whiteloglist",
                component: () => import("@/views/whiteloglist/List.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }

            },
            {
                path: "/dataStat/dailyOperation",
                name: "dailyOperation",
                component: () => import("@/views/statist/Daily.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }

            },
            {
                path: "/good/productList",
                name: "productList",
                component: () => import("@/views/good/ProductList.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }

            },
            {
                path: "/user/reportList",
                name: "reportList",
                component: () => import("@/views/user/ReportList.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }

            },
            {
                path: "/operation/bannerList",
                name: "bannerList",
                component: () => import("@/views/banner/List.vue"),
                meta: {
                    needAuth: ["admin", "kaifa","yunyin","chanpin"]
                }

            },
        ]
    },
    {
        path: "/login",
        name: "Login",
        component: () => import("@/views/Login.vue"),
        meta: {
            needAuth: ["admin", "kaifa","yunyin","chanpin"]
        }
    },
    {
        path: "/:pathMatch(.*)*",
        name: "NotFound",
        component: () => import("@/views/NotFound.vue"),
        meta: {
            needAuth: ["admin", "kaifa","yunyin","chanpin"]
        }
    }
]

export default routes